{% include 'single_style.css' with context %}
{% block body %}

	<table cellpadding="0" cellspacing="0" border="0">
            <tr><td colspan="6" class="table-header"><b>MAGAZZINO:</b> {{dao.magazzino}} <br/><b>ARTICOLO: CODICE:</b> {{dao.codice_articolo}}  - <b>C/BARRE:</b> {{dao.arti.codice_a_barre}} <br /> <b>DENOM:</b> {{dao.articolo}}</td></tr>
            <tr>
                <td width="25%" class="odd-detail">Scorta minima</td>
                <td width="25%" class="odd-detail"><strong>{{dao.scorta_minima|nonone}}</strong></td>
                <td width="25%" class="odd-detail">Livello riordino</td>
                <td width="25%" class="odd-detail"><strong>{{dao.livello_riordino|nonone}}</strong></td>
            </tr>
            <tr>
                <td width="20%" class="even-detail" >Data fine scorte</td>
                <td class="even-detail">
                    {% if dao.data_fine_scorte %}
                        <strong>{{utils.dateToString(dao.data_fine_scorte)}}</strong>
                    {% endif %}
                </td>
                <td width="20%" class="even-detail" >Data prossimo ordine</td>
                <td class="even-detail">
                     {% if dao.data_prossimo_ordine %}
                        <strong>{{utils.dateToString(dao.data_prossimo_ordine)}}</strong>
                    {% endif %}
                </td>
            </tr>
</table><br />
<table cellpadding="0" cellspacing="0" border="0">
            <tr><td colspan="6" class="table-header">Situazione magazzino</td></tr>
            <tr class="even-detail">
                <td class="even-number" style="text-align:center;" width="41%" style="padding-left:20px;" > Dati MOVIMENTO</td>
                <td class="even-number" style="text-align:center;" width="7%">Carico</td>
                <td class="even-number" style="text-align:center;" width="7%">Scarico</td>
                <td class="even-number" style="text-align:center;" width="7%">Valore Carico</td>
                <td class="even-number" style="text-align:center;" width="7%">Valore Scarico</td>
                <td class="even-number" style="text-align:center;" width="1%">+/-</td>
            </tr>
            {% for item in dao.totaliOperazioniMovimento %}
            {{item['segnoOperazione']}}
            <tr >
            <td class="odd-detail" style="padding-left:5px;">N° {{item['numero']}} - {{item['operazione']}} - Del: {{utils.dateToString(item['data_movimento'])}} - Rag_soc.:{{item['fornitore'][0:9]|string}}{{item['cliente'][0:9]|string}}</td>

            {% if item['segnoOperazione'] == "+" %}
                <td class="odd-number" style="text-align:center;" >{{'%14.2f' % (item['giacenza'],)}}</td>
            {% else %}
                <td class="odd-number" style="text-align:center;" >  </td>
            {% endif %}
                {% if item['segnoOperazione'] == "-" %}
                <td class="odd-number" style="text-align:center;" >{{'%14.2f' % (item['giacenza'],)}} </td>
            {% else %}
                <td class="odd-number" style="text-align:center;" >  </td>
            {% endif %}
                {% if item['segnoOperazione'] == "+" %}
                <td class="odd-number" style="text-align:center;">{{'%14.2f' % item['valore']|abs}}</td>
            {% else %}
                <td class="odd-number" style="text-align:center;" >  </td>
            {% endif %}
                {% if item['segnoOperazione'] == "-" %}
                <td class="odd-number" style="text-align:center;">{{'%14.2f' % item['valore']|abs}}</td>
            {% else %}
                <td class="odd-number" style="text-align:center;" >  </td>
            {% endif %}
            <td class="odd-number" style="text-align:center;" >{{item['segnoOperazione']}}</td>
            </tr>
            {% endfor %}
            <tr>
                <td class="totale-detail"><strong>Totali</strong></td>
                <td></td>
                <td class="totale-number" style="text-align:center;"><strong>{{'%14.2f' % (dao.giacenza, )}}</strong></td>
                <td class="totale-number" style="text-align:center;"><strong>{{'%14.2f' % (dao.valoreGiacenza, )}}</strong></td>
            </tr>
</table>
{% endblock %}
